const mongoose = require('mongoose')
const Schema = mongoose.Schema

let codeSchema = new Schema(
  {
    // email
    email: {
      type: String,
      required: true
    },
    // 验证码
    code: {
      type: Number,
      required: true
    },
    // 验证码生成时间
    date: {
      type: Number,
      default: Date.now
    },
  },
  {
    versionKey:false
  }
)
  
module.exports = mongoose.model("regcode", codeSchema)